home *** CD-ROM | disk | FTP | other *** search
- /*
- DSKEL-XS v1.1
-
- (Xpress User Stats DOOR)
-
- 1 2 3
- (123456789012345678901234567890123456789)
- Conf Access : XX_X____X___s__sX______X______________X
- Caller Num. : 100888
- 1st Date On : 22 Apr 91
- Lst Date On : 7 Mar 92
- Security Lv : 255
- # Times On : 1123 Today : 4
- Msgs Posted : 1500 Today : 0
- File Ratio : Disabled
- Byte Ratio : Disabled
- # Downloads : 71 Today : 0
- # Uploads : 85 Today : 0
- Bytes DL'd : 137936061 Today : 39994
- Bytes UL'd : 8089329 Today : 4433
- Online Baud : 14400
- Screen Clear: On
- Time Bar : Off
- Bytes Avail : 3000000
-
-
- */
- //**********************
- //***** Includes *****
- //**********************
-
- #include <proto/all.h>
- #include <stdio.h>
- #include <time.h>
-
- #include <string.h>
- #include <tempest/headers.h>
-
- //********************************
- //***** Structures/Defines *****
- //********************************
-
- struct MyMessage
- {
- struct Message Msg;
- struct User User;
- char text[255];
- char text1[255];
- int car,Value,Data;
- long LongValue;
- int IntValue;
- };
-
- struct User User;
- struct MsgPort *MyPort = NULL;
- struct MyMessage *msg;
-
- void GetStr(char s[],int opt);
- int DOORIO();
-
- int EXIT_FLAG, DOOR_DATA, DOOR_CAR, DOOR_VALUE, DOOR_VALUE1 = 0,first = 0;
- char DOOR_MSG [255],DOOR_MSG1[255],MyName[255],st[100];
-
- //*****************************
- //***** PL (Print Line) *****
- //*****************************
-
- void pl(fmt,a1,a2,a3)
- char *fmt;
- { char s[255]; sprintf(s,fmt,a1,a2,a3); DOOR_DATA=1; strcpy(DOOR_MSG,s); DOORIO(); }
-
- //******************
- //***** Main *****
- //******************
-
- main(int argc,char *argv[])
- {
- char string[255],string1[255];
- char Day[5],Month[5],Year[5];
- register int x=1;
- if(!DoorStart(argv[1])) { PutStr("DSKEL-XS v1.1 [Xpress Stats]\n"); exit(0); }
- strcpy(string,User.MsgBase);
- do
- {
- if(string[x] == 'N') string[x] = '_';
- else if(string[x] == 'S') string[x] = 's';
- else string[x] = 'X';
- x++;
- }
- while(x < 40);
- strmid(string,string1,2,39);
- pl("\f\r\n 1 2 3\r\n");
- pl(" (123456789012345678901234567890123456789)\r\n");
- pl("Conf Access : %s\r\n",string1);
- //********************************************************************
- GetStr(string1,95);
- pl("Caller Num. : %s\r\n",string1);
- //********************************************************************
- strcpy(string,ctime(&User.Time_First_Called));
- strmid(string,Month,5,3);
- strmid(string,Day,9,2);
- strmid(string,Year,23,2);
- pl("1st Date On : %2s %s %s\r\n",Day,Month,Year);
- //********************************************************************
- strcpy(string,ctime(&User.Time_Last_Logoff));
- strmid(string,Month,5,3);
- strmid(string,Day,9,2);
- strmid(string,Year,23,2);
- pl("Lst Date On : %2s %s %s\r\n",Day,Month,Year);
- //********************************************************************
- pl("Security Lv : %d\r\n",User.Security);
- //********************************************************************
- pl("# Times On : %-5d Today : %d\r\n",User.Total_Calls,User.Period_Calls);
- //********************************************************************
- pl("Msgs Posted : %-5d Today : %d\r\n",User.Total_Posts,User.Period_Posts);
- //********************************************************************
- if(User.F_Ratio==0) strcpy(string1,"Disabled");
- else sprintf(string1,"%d/1",User.B_Ratio);
- pl("File Ratio : %s\r\n",string1);
- //********************************************************************
- if(User.B_Ratio==0) strcpy(string1,"Disabled");
- else sprintf(string1,"%d/1",User.B_Ratio);
- pl("Byte Ratio : %s\r\n",string1);
- //********************************************************************
- pl("# Downloads : %-4d Today : %d\r\n",User.Total_DLFiles,User.Period_DLFiles);
- //********************************************************************
- pl("# Uploads : %-4d Today : %d\r\n",User.Total_ULFiles,User.Period_ULFiles);
- //********************************************************************
- pl("Bytes DL'd : %-10ld Today : %ld \r\n",User.Total_DLBytes,User.Period_DLBytes);
- //********************************************************************
- pl("Bytes UL'd : %-10ld Today : %ld\r\n",User.Total_ULBytes,User.Period_ULBytes);
- //********************************************************************
- GetStr(string1,19);
- pl("Online Baud : %s\r\n",string1);
- //********************************************************************
- if(User.UserBitsA & 0x00000400L) strcpy(string1,"On");
- else strcpy(string1,"Off");
- pl("Screen Clear: %s\r\n",string1);
- //********************************************************************
- if(User.UserBitsA&0x00000008L) strcpy(string1,"On");
- else strcpy(string1,"Off");
- pl("Time Bar : %s\r\n",string1);
- //********************************************************************
- pl("Bytes Avail : %ld\r\n\r\n",User.Left_DLBytes);
- //********************************************************************
-
- //*************************
- //***** Close Stuff *****
- //*************************
- DOOR_DATA=99;
- strcpy(DOOR_MSG,'\0');
- DOORIO();
- while(msg=(struct MyMessage *)GetMsg(MyPort)) ReplyMsg((struct Message *)msg);
- if(MyPort) DeletePort(MyPort);
- exit(0);
- }
-
-
-
-
-
-
-
-
-
-
-
- //********************
- //***** DoorIO *****
- //********************
-
- int DOORIO()
- {
- struct MsgPort *HisPort;
- struct MyMessage message;
- int UPDATE;
- if(EXIT_FLAG) return 0;
- UPDATE=0;
- HisPort = FindPort(st);
- if(HisPort!=NULL)
- {
- message.Msg.mn_Node.ln_Type = NT_MESSAGE;
- message.Msg.mn_Length = sizeof(message);
- message.Msg.mn_ReplyPort = MyPort;
- if(first)CopyMem(&User,&message.User,sizeof(struct User));
- message.car = 0;
- message.Data = DOOR_DATA;
- message.Value = DOOR_VALUE;
- message.IntValue = DOOR_VALUE1;
- strcpy(message.text,DOOR_MSG);
- strcpy(message.text1,DOOR_MSG1);
- PutMsg((struct MsgPort *)HisPort,(struct Message *)&message);
- Wait(1 << MyPort->mp_SigBit);
- GetMsg(MyPort);
- DOOR_DATA = message.Data;
- DOOR_VALUE = message.Value;
- DOOR_VALUE1 = message.IntValue;
- strcpy(DOOR_MSG,message.text);
- strcpy(DOOR_MSG1,message.text1);
- CopyMem(&message.User,&User,sizeof(struct User));
- first=1;
- UPDATE=0;
- if(message.car) EXIT_FLAG=1;
- }
- return 0;
- }
-
- //************************
- //***** Door Start *****
- //************************
-
- DoorStart(char node[])
- {
- struct MsgPort *HisPort;
- EXIT_FLAG = 0;
- sprintf(st,"%s:TEMPEST_DOOR",node);
- HisPort = FindPort(st);
- if(HisPort==NULL) return (FALSE);
- sprintf(MyName,"%s:DOOR_PORT",node);
- MyPort = CreatePort(MyName,0L);
- if(MyPort==NULL)
- {
- PutStr("Cant open port");
- return(int)FALSE;
- }
- DOORIO();
- return (int)TRUE;
- }
-
- //*********************************
- //***** GetStr (Get String) *****
- //*********************************
-
- void GetStr(char s[],int opt)
- { DOOR_DATA=15; DOOR_VALUE=opt; strcpy(s,'\0'); DOORIO(); strcpy(s,DOOR_MSG); }
-